﻿(function ($) {
    $.fn.messageContainer = function (customOptions) {
        var options = $.extend({}, $.fn.messageContainer.defaultOptions, customOptions);
        return this.each(function () {
            var $this = $(this);

            $this.addClass("ui-state-" + options.state + " ui-corner-all");
            $this.css("padding", "2px");
            $this.css("margin", "5px 0 5px 0");

            $this.append('<p>');

            if (options.icon != "") {
                $this.append('<span class="ui-icon ui-icon-' + options.icon + '" style="float: left; margin-right: .3em;"></span>');
            }

            $this.append(options.message);

            $this.append('</p>');
        });
    };

    $.fn.messageContainer.defaultOptions = {
        state: "highlight",
        icon: "",
        message: ""
    }
})(jQuery);